﻿using Abp.Domain.Repositories;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Yozeev.BusinessLogic;

namespace Yozeev.Controllers.Stats.Filters
{
    public class ScheduleFilter : AbstractFilter
    {
        private readonly IRepository<Schedule, Guid> _scheduleRep;

        public ScheduleFilter(IRepository<Schedule, Guid> scheduleRep)
        {
            _scheduleRep = scheduleRep;
        }

        public override void Decorate(Dictionary<string, IEnumerable<object>> Data)
        {
            if (Data.ContainsKey("Schedules")) return;
            var schedules = _scheduleRep.GetAll();
            Data.Add("Schedules", schedules.ToList());
        }
    }
}
